-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[dotnet] [bidi] Implement browsing context download events #16382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[dotnet] [bidi] Implement browsing context download events #16382
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
PR Code Suggestions ✨Explore these optional code suggestions:
|
User description
https://w3c.github.io/webdriver-bidi/#event-browsingContext-downloadWillBegin
https://w3c.github.io/webdriver-bidi/#event-browsingContext-downloadEnd
💥 What does this PR do?
Fix
downloadWillBegin
event signature, implementdownloadEnd
event. Adding tests.🔄 Types of changes
PR Type
Enhancement
Description
Fix
downloadWillBegin
event signature to use proper event argsImplement new
downloadEnd
event with polymorphic event argsAdd comprehensive tests for both download events
Create JSON converters for proper serialization
Diagram Walkthrough
File Walkthrough
BrowsingContext.cs
Update download event method signatures
dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContext.cs
OnDownloadWillBeginAsync
method signatures to useDownloadWillBeginEventArgs
OnDownloadEndAsync
methods for both sync and async handlersBrowsingContextModule.cs
Update module download event subscriptions
dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextModule.cs
OnDownloadWillBeginAsync
method signatures to use proper eventargs
OnDownloadEndAsync
methods subscribing tobrowsingContext.downloadEnd
DownloadEndEventArgs.cs
Create download end event args classes
dotnet/src/webdriver/BiDi/BrowsingContext/DownloadEndEventArgs.cs
DownloadEndEventArgs
DownloadCanceledEventArgs
andDownloadCompleteEventArgs
derived types
DownloadWillBeginEventArgs.cs
Create download will begin event args
dotnet/src/webdriver/BiDi/BrowsingContext/DownloadWillBeginEventArgs.cs
DownloadWillBeginEventArgs
record with suggested filenameIBaseNavigationInfo
interface for navigation contextDownloadEndEventArgsConverter.cs
Create polymorphic download end converter
dotnet/src/webdriver/BiDi/Communication/Json/Converters/Polymorphic/DownloadEndEventArgsConverter.cs
DownloadEndEventArgs
canceled
andcomplete
status discriminatorsBroker.cs
Register download end event converter
dotnet/src/webdriver/BiDi/Communication/Broker.cs
DownloadEndEventArgsConverter
for polymorphic JSONserialization
BiDiJsonSerializerContext.cs
Register download event types for serialization
dotnet/src/webdriver/BiDi/Communication/Json/BiDiJsonSerializerContext.cs
BrowsingContextEventsTest.cs
Add download events integration tests
dotnet/test/common/BiDi/BrowsingContext/BrowsingContextEventsTest.cs
downloadWillBegin
event with file download simulationdownloadEnd
event verifying completion and filepath